<template>
	<view class="item_box" >
		<view class="left">
			<image :src='item.thumb_url'></image>
			<view class="vertical">
				<view>
					<view class="name">{{item.goods_name}}</view>
					<view class="coupon">
						<view class="label">
							优惠券
						</view>
						<view class="coupon_price">
							立减{{item.coupon}}
						</view>
					</view>
				</view>
				<view class='price'>¥{{item.min_price}}</view>
			</view>
		</view>
		<view class="right"  >
			<view class="icon">
				<image src="../static/images/icon_car.png"></image>
			</view>
			<view class="goTocar" @click="getnav">
				立即购买
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"shopItem",
		data() {
			return {
				
			};
		},
		props:[
			'item'
		],
		methods:{
			getnav(e){
				var navitem = 1
				uni.navigateTo({
					url:`/pagesC/homeSon/goodsDetails?id=${this.item.id}&navitem=${navitem}`
				})
			}
		}
	}
</script>

<style lang="less">
	.item_box{
		display: flex;
		flex-direction: row;
		width: 100vw;
		margin: 20rpx 3vw;
		width: 94vw;
	}
	.left{
		display: flex;
		// width: 70vw;
		image{
			width: 200rpx;
			height: 200rpx;
			background-color: #000000;
			border-radius: 15rpx;
		}
		.vertical{
			width: 35vw;
			display: flex;
			flex-direction: column;
			height: 200rpx;
			// justify-content: space-between;
			color: #f9a116;
			margin-left: 10rpx;
			justify-content: space-between;
			.name{
				width: 400upx;
				font-size: 30rpx;
				color: #000;
				overflow: hidden;
				text-overflow: ellipsis;
				 // white-space: nowrap;
			}
			.coupon{
				
				display: flex;
				margin-top: 10rpx;
				width: 200rpx;
				height: 50rpx;
				border-radius: 5rpx;
			
				border: solid 1rpx #f9a116;
				justify-content: space-around;
				align-items: center;
				.label{
					border-right: 1px dotted #f9a116;
				}
				view{
					flex: 1;
					font-size: 24rpx;
					height: 48rpx;
					line-height: 48rpx;
					text-align: center;
				}
			}
			.price{
				font-size: 40rpx;
			}
		}
	}
	.right{
		flex: 1;
		display: flex;
		align-items: flex-end;
		.icon{
			width: 80rpx;
			height: 60rpx;
			background-color: #f5f5f5;
			border-radius: 10rpx 0rpx 0rpx 10rpx;
		}
		.goTocar{
			width: 160rpx;
			height: 60rpx;
			background-color: #ff3d3d;
			border-radius: 0rpx 10rpx 10rpx 0rpx;
			color: #fff;
			line-height: 60rpx;
			font-size: 30rpx;
			text-align: center;
		}
		image{
			width: 34rpx;
			margin: 14rpx 23rpx;
			height: 32rpx;
		}
	}
</style>
